<form id="add-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    <input id="type" name="row[type]" type="text" class="hidden" value="{$typeid}">
    <div class="form-group">
        <label for="name" class="control-label col-xs-12 col-sm-2">{:__('name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="name" class="form-control" name="row[name]" type="text" value="" data-rule="required" >
        </div>
    </div>
    <div class="form-group">
        <label for="c-avatar" class="control-label col-xs-12 col-sm-2">{:__('avatar')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline">
                <input id="c-avatar" class="form-control" size="50" name="row[avatar]" type="text" value="" data-rule="required"><br>
                <span><button id="plupload-avatar" class="btn btn-danger plupload" data-mimetype="jpg" data-input-id="c-avatar" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                <ul class="row list-inline plupload-preview" id="p-avatar"></ul>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="tag" class="control-label col-xs-12 col-sm-2">{:__('tag')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="tag" class="form-control" name="row[tag]" type="text" value="" data-rule="required" >
        </div>
    </div>
    <div class="form-group">
        <label for="createtime" class="control-label col-xs-12 col-sm-2">{:__('createtime')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input type="text" class="form-control datetimepicker" id="createtime" name="row[createtime]" value="" data-date-format="YYYY-MM-DD" data-rule="{:__('createtime')}:required" size="6" />
        </div>
    </div>

    <div class="form-group">
    <label for="serverdays" class="control-label col-xs-12 col-sm-2">{:__('serverdays')}:</label>
    <div class="col-xs-12 col-sm-8">
        <select  id="serverdays" data-rule="required" class="form-control selectpicker" name="row[serverdays_id]">
            <option value="" selected="true" disabled="true">选择类型</option>
            {foreach name="serverdaysList" item="vo"}
            <option value="{$vo.server_days}" >{$vo.server_days}天</option>
            {/foreach}
        </select>
    </div>
</div>

    <div class="form-group">
        <label for="price" class="control-label col-xs-12 col-sm-2">{:__('price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="price" class="form-control" name="row[price]" type="number" value="" data-rule="required" >
        </div>

    </div>
    <div class="form-group">
        <label for="province" class="control-label col-xs-12 col-sm-2">{:__('province')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="province" data-rule="required" class="form-control selectpicker" name="row[province_id]">
                <option value="" selected="true" disabled="true">选择类型</option>
                {foreach name="provincelist" item="vo"}
                <option value="{$vo.id}" >{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label for="c-grade" class="control-label col-xs-12 col-sm-2">{:__('grade')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-grade" data-rule="required" class="form-control selectpicker" name="row[grade_id]">
                <option value="" selected="true" disabled="true">选择类型</option>
                {foreach name="gradeList" item="vo"}
                <option value="{$vo.id}" >{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="c-grade_info" class="control-label col-xs-12 col-sm-2">{:__('grade_info')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-grade_info" class="form-control" name="row[grade_info]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label for="c-expert_comment" class="control-label col-xs-12 col-sm-2">{:__('expert_comment')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-expert_comment" class="form-control" name="row[expert_comment]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label for="c-birthday" class="control-label col-xs-12 col-sm-2">{:__('birthday')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input type="text" onblur="getshengxiao(this.value)" class="form-control datetimepicker" id="c-birthday" name="row[birthday]" value="" data-date-format='YYYY-MM-DD' data-rule="{:__('birthday')}:required" size="6" />
        </div>
    </div>

    <div class="form-group">
        <label for="animals" class="control-label col-xs-12 col-sm-2">{:__('animalsyear')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="animals" data-rule="required"  name="row[animalsyear_id]">
                <option value="" selected="true" disabled="true">选择类型</option>
                {foreach name="animalsList" item="vo"}
                <option value="{$vo.id}" >{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <script type="text/javascript">

        function getshengxiao(data)
        {
            var year = (new Date(data)).getFullYear();
            var arr = ['9', '10', '11', '12', '1', '2', '3', '4', '5', '6', '7', '8'];
            $("#animals option").eq(arr[year % 12]).attr("selected",true);
        }
    </script>
    <div class="form-group">
        <label for="c-telphone" class="control-label col-xs-12 col-sm-2">{:__('telphone')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-telphone" class="form-control" name="row[telphone]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label for="c-address" class="control-label col-xs-12 col-sm-2">{:__('address')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-address" class="form-control" name="row[address]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label for="c-resume" class="control-label col-xs-12 col-sm-2">{:__('resume')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="form-inline">
                <input id="c-resume" class="form-control" size="50" name="row[resume]" type="text" value="" data-rule="required"><br>
                <span><button id="plupload-resume" class="btn btn-danger plupload" data-mimetype="pdf" data-input-id="c-resume" data-preview-id="p-resume"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="c-online" class="control-label col-xs-12 col-sm-2">{:__('online')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[online]', ['normal'=>__('isonline'), 'hidden'=>__('noonline')])}
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
